package com.itheima;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class test {
    public static void main(String[] args) {
        ArrayList<Character> list=new ArrayList<>();
        for (int i = 0; i < 26; i++) {
            list.add((char)(65+i));
            list.add((char)(97+i));
        }
        Random r=new Random();

        int index = r.nextInt(10);
        Collections.shuffle(list);
        String result="";
        for (int i = 0; i < 4; i++) {
            result=result+list.get(i);
        }
        result+=index;

        char[] chars = result.toCharArray();
        int flag = r.nextInt(5);
        char temp=chars[4];
        chars[4]=chars[flag];
        chars[flag]=temp;
        String s=new String(chars);
    }
}
